﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="2016020719_2.aspx.cs" Inherits="web8._2016020719_2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:DropDownList ID="DropDownList1" runat="server" 
            DataSourceID="SqlDataSource1" DataTextField="inc_name" DataValueField="inc_id">
        </asp:DropDownList>
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SystemConnectionString2 %>" 
            SelectCommand="SELECT [inc_id], [inc_name] FROM [list_newclass]">
        </asp:SqlDataSource>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="news_id" DataSourceID="SqlDataSource2">
            <Columns>
                <asp:BoundField DataField="news_id" HeaderText="news_id" ReadOnly="True" 
                    SortExpression="news_id" />
                <asp:BoundField DataField="news_ttl" HeaderText="news_ttl" 
                    SortExpression="news_ttl" />
                <asp:BoundField DataField="news_date" HeaderText="news_date" 
                    SortExpression="news_date" />
            </Columns>
        </asp:GridView>
    
    </div>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SystemConnectionString3 %>" 
            
        SelectCommand="SELECT [news_id], [news_ttl], [news_date] FROM [tb_news] WHERE ([news_cid] = @news_cid)">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" DefaultValue="1" 
                    Name="news_cid" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
